home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005.7z / CHIP Utilities 2005.iso / CHIP Utilities / Zarzadzanie i bezpieczenstwo systemu / MBSA / MBSASetup-EN.msi / Data.Cab / reportdetailsSQL.xsl < prev    next >
Extensible Markup Language  |  2004-08-13  |  3KB  |  70 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.     
  4.     <xsl:variable name="CheckID" select="'CheckIDHere'"></xsl:variable>
  5.     <xsl:variable name="InstanceName" select="'InstanceNameHere'"></xsl:variable>
  6.  
  7.     <xsl:variable name="ScoreLookup">
  8.       <c score="0" url="Graphics/dash.gif" alttext="Check Not Performed"/>
  9.       <c score="1" url="Graphics/excl_red.gif" alttext="Unable to scan"/>
  10.       <c score="2" url="Graphics/x_red.gif" alttext="Check failed (critical)"/>
  11.       <c score="3" url="Graphics/x_gold.gif" alttext="Check failed (non-critical)"/>
  12.       <c score="4" url="Graphics/astrx.gif" alttext="Best practice"/>
  13.       <c score="5" url="Graphics/chek_grn.gif" alttext="Check passed"/>
  14.       <c score="7" url="Graphics/info.gif" alttext="Additional information"/>
  15.     </xsl:variable>
  16.     
  17.     <xsl:template match="SecScan">
  18.         <xsl:choose>
  19.         <xsl:when test='SQLInstance[@Name=$InstanceName]'>
  20.             <h1><xsl:value-of select="SQLInstance/Check[@ID=$CheckID]/Advice"/></h1>
  21.             <h2>Result Details for SQL Instance  <xsl:value-of select="$InstanceName"/><br /><br /><xsl:value-of select="Check[@ID=$CheckID]/Detail/@text"/></h2>
  22.             <table id="TableID" width="100%" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px #000000; padding-left: 10px; padding-right: 10px;">
  23.             <tr class="DetailHeader">
  24.                 <td class="ReportListHeader" style="width:40" align="center" valign="middle"><nobr>  Score  </nobr></td>
  25.                 <xsl:for-each select="SQLInstance[@Name=$InstanceName]/Check[@ID=$CheckID]/Detail/Head/Col">
  26.                     <td nowrap="nowrap">
  27.                         <xsl:value-of select="."/> 
  28.                     </td>
  29.                 </xsl:for-each>
  30.             </tr>
  31.             
  32.             <xsl:for-each select="SQLInstance[@Name=$InstanceName]/Check[@ID=$CheckID]/Detail">
  33.                 <xsl:apply-templates select="Row">
  34.                 </xsl:apply-templates>
  35.             </xsl:for-each>
  36.             </table>
  37.         </xsl:when>
  38.         </xsl:choose>
  39.     </xsl:template>
  40.  
  41.     <xsl:template match="Row">
  42.     <xsl:param name="score" select="@Grade"/>
  43.         <tr>
  44.             <td valign="top" align="center">
  45.                 <xsl:choose>
  46.                   <xsl:when test="../../@ID='121'">
  47.                     <img alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@url}" />
  48.                   </xsl:when>
  49.                   <xsl:otherwise>
  50.                     <IMG alt="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext}" src="{document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@url}" />
  51.                   </xsl:otherwise>
  52.                 </xsl:choose>    
  53.             </td>
  54.             <xsl:for-each select="Col">
  55.             <td valign="top">
  56.              <xsl:choose>
  57.               <xsl:when test="@URL and @URL != '' and @URL != ' '">
  58.                 <A target="_blank" href="{@URL}"><xsl:value-of select="."/></A>
  59.               </xsl:when>
  60.               <xsl:otherwise>
  61.                 <xsl:value-of select="."/>
  62.               </xsl:otherwise>
  63.             </xsl:choose>    
  64.             </td>
  65.             </xsl:for-each>
  66.         </tr>
  67.     </xsl:template>
  68.     
  69. </xsl:stylesheet>
  70.